package com.D5Power.simulator
{
	import com.D5Power.Objects.CharacterObject;
	import com.D5Power.Objects.GameObject;
	import com.D5Power.Objects.NCharacterObject;
	import com.D5Power.scene.BaseScene;


	public class Simulator extends BasicSimulator
	{
		public function Simulator(gs:BaseScene)
		{
			super(gs);
		}
		
		public function run():void
		{
			generateActions();
			_gs.render();
		}
		
		private function generateActions():void
		{
			for each(var c:GameObject in _gs.getAllObjects())
			{
				if(c is CharacterObject)
				{
					var c_turn:CharacterObject = c as CharacterObject;
					c_turn.controler.perception.me = c_turn;
					c_turn.calcAction();
				}
				
				if(c is NCharacterObject)
				{
					var nc:NCharacterObject = c as NCharacterObject;
					nc.controler.me = nc;
					nc.calcAction();
				}
			}
		}
		
		private function updateScene():void
		{
		}
	}
}